<template>
	<view>
		<view class="upper">
			<view :style="{height: (navigationBarHeight + statusBarHeight) + 'px'}"></view>
			<view class="title">
				<image class="title_AI" src="https://img.wilmer.com.cn/admin/2024/3-22/WechatIMG23.jpg" mode="">
				</image>
				<image class="title_nav" src="https://img.wilmer.com.cn/admin/2024/3-22/WechatIMG22.jpg" mode="">
				</image>
			</view>
			<view class="title_text" style="margin-top: 40rpx;">
				<view class="icon"></view>
				<text>一分钟获取选校方案</text>
			</view>
			<view class="title_text">
				<view class="icon"></view>
				<text>AI智能选校</text>
			</view>
		</view>
		<view class="below">
			<view class="explain">收录1000+院校</view>
			<view class="explain">基于科学的拟合算法</view>
			<view class="explain">征集多方专家方案</view>
			<view class="btn conter" @click="startTest()">开始测试</view>
		</view>
	</view>
</template>

<script>
	import {
		UserTokenKey
	} from '../../static/libs/config.js'
	export default {
		data() {
			return {
				token: "",
				statusBarHeight: 0, // 状态栏高度
				navigationBarHeight: 44, // 导航栏高度
			}
		},
		onShow() {
			this.token = uni.getStorageSync(UserTokenKey)
			// 获取状态栏高度
			const systemInfo = uni.getSystemInfoSync();
			this.statusBarHeight = systemInfo.statusBarHeight || 0;
		},
		methods: {
			startTest() {
				if (this.token == '' || this.token == undefined || this.token == null) {
					this.$toast('请登陆后再尝试该功能')
					setTimeout(() => {
						uni.navigateTo({
							url: '/pages/Login/Login-shortcut'
						})
					},1000)
					return false
				}

				uni.navigateTo({
					url: '/pages/customer/Choose'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.upper {
		background: url('https://img.wilmer.com.cn/admin/2024/3-13/WechatIMG264.jpg') no-repeat;
		background-size: 100% 100%;
		width: 100vw;
		height: 360px;

		.title {
			margin-top: 20rpx;
			margin-left: 32rpx;
			display: flex;
			align-items: flex-end;

			.title_AI {
				width: 196rpx;
				height: 144rpx;
			}

			.title_nav {
				width: 414rpx;
				height: 106rpx;
				margin-left: 48rpx;
			}
		}

		.title_text {
			display: flex;
			align-items: center;
			margin-left: 44rpx;
			margin-top: 20rpx;

			.icon {
				width: 24rpx;
				height: 24rpx;
				background-color: #fff;
				border-radius: 50%;
				border: 6rpx solid #007AFF;
				box-sizing: border-box;
				margin-right: 14rpx;
			}

			text {
				font-family: PingFang SC;
				font-size: 48rpx;
				font-weight: 500;
				color: #007AFF;
			}
		}
	}

	.below {
		background: url('https://img.wilmer.com.cn/admin/2024/3-13/WechatIMG265.jpg') no-repeat;
		background-size: 100% 100%;
		width: 100vw;
		height: calc(100vh - 360px - 32rpx);
		padding-top: 32rpx;
		position: relative;

		.explain {
			font-family: PingFang SC;
			font-size: 16px;
			font-weight: 400;
			letter-spacing: 0.03em;
			margin-left: 40rpx;
			margin-top: 24rpx;
		}

		.btn {
			width: 686rpx;
			height: 100rpx;
			border-radius: 50rpx;
			font-family: PingFang SC;
			font-size: 24px;
			font-weight: 500;
			letter-spacing: 0.03em;
			color: #fff;
			background: #007AFF;
			position: absolute;
			bottom: 80rpx;
			left: 50%;
			transform: translate(-50%, 0);
		}
	}
</style>